Overview of AppleScript
AppleScript is a dynamic, object-oriented scripting language. Its key feature is the ability to send commands to objects in many different applications, including the Mac OS itself. An
object
is an item, such as a file or folder in a Finder window, a word or paragraph in a text-editing application, or a shape in a drawing application, that can respond to commands by performing actions. AppleScript determines dynamically--that is, whenever necessary--which objects and commands an application recognizes based on information stored in each scriptable application.
In addition to manipulating objects in other applications, AppleScript can store and manipulate its own data, called
values
. Values are simple data structures, such as character strings and real numbers, that can be represented in scripts and manipulated with operators. Values can be obtained from applications or created in scripts.
The building blocks of scripts are
statements
. When you write a script, you compose statements that describe the actions you want to perform. AppleScript provides several kinds of statements that allow you to control when and how statements are executed. These include If statements for conditional execution, Repeat statements for statements that are repeated, and handler definitions for creating user-defined commands.
This chapter provides an overview of AppleScript in the following sections:
-
Conventions Used in This Guide
describes conventions you should be familiar with before reading the rest of this guide.
-
What Is AppleScript?
provides a brief introduction to AppleScript by answering some frequently asked questions.
-
How AppleScript Works
describes the basic mechanisms AppleScript provides to create, compile, and run scripts, and to communicate with and control scriptable applications.
-
Statements
provides an overview of the kinds of statements you use to write scripts.
-
Commands and Objects
describes the words and phrases you use in AppleScript statements to request actions or results. It also describes the kinds of objects that serve as targets for commands.
-
Dictionaries
describes how AppleScript works with applications to determine the words an application understands.
-
Values and Constants
describes the types of values and predefined constants AppleScript supports.
-
Expressions
describes AppleScript expressions, which are made up of operations and variables.
-
Script Objects
describes an advanced feature of AppleScript that lets you define and use objects in scripts.
-
Scripting Additions
describes a mechanism for providing AppleScript with additional commands.
-
Dialects
describes AppleScript's ability to work with scripts in different representations, though only an English dialect is currently supported.
-
Other Features and Language Elements
describes features of the AppleScript scripting language used throughout this guide.
© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)